package org.demo.db.xsd;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 元数据：table element
 * @author  
 * @date    2010-8-30
 * @file    org.gen.db.meta.TableEl.java
 */
public class TableEl {
	private String name;
	private String fileName;
	private String ownerShip;
	private Map<String,FieldEl> fields = new HashMap<String,FieldEl>();
	private List<TableEl> tables = new ArrayList<TableEl>();
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFileName() {
		if (fileName == null || fileName.equals("")){
			fileName = getName().toUpperCase();
		}
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getOwnerShip() {
		if (ownerShip == null){
			ownerShip = "true";
		}
		return ownerShip;
	}
	public void setOwnerShip(String ownerShip) {
		if (ownerShip == null || "true".equals(ownerShip) 
				|| "".equals(ownerShip)){
			this.ownerShip = "true";
		} else {
			this.ownerShip = "false";
		}
	}
	public Map<String,FieldEl> getFields() {
		return fields;
	}
	public void setFields(Map<String,FieldEl> fields) {
		this.fields = fields;
	}
	public List<TableEl> getTables() {
		return tables;
	}
	public void setTables(List<TableEl> tables) {
		this.tables = tables;
	}
}
